<?php
/*
 * Data Explorer: Additional Data Sources
 *      additionalSources.php
 *
 * last modified: 3/1/11
 * author: James Duran
 *
 * description: Provides an interface for additional data sources, to be
 *              used in complement with a given dataset. These sources usually
 *              fill additional data dimensions present within the radio
 *              elements within the main interface.
 *
 * comments: n/a
 */

// get parameters in the url
$ds = $_GET["ds"];
$q = $_GET["q"];
$xml = "Error, no dataset selected.";

// additional data source for the FAA Web Service,
// provided by flyontime.us
if($ds == "faaws") {
    header("Content-Type:text/xml");
    $xml = file_get_contents("http://flyontime.us/airports/" . $q . ".xml");
}

// data source for the USGS water quality web service
if($ds == "usgs") {
  header("Content-Type:text/xml");
  $xml = file_get_contents("http://qwwebservices.usgs.gov/Result/search?countrycode=US&siteid=" . $q . "&mimeType=xml");
}

// return the retrieved xml document
echo $xml;
